// var gaode_vector = new ol.layer.Tile({
//   title: "高德地图-矢量图层",
//   source: new ol.source.XYZ({
//     url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
//     wrapX: false,
//     /* 地图下载需要添加跨域参数 */
//     crossOrigin: "Anonymous",
//   }),
// });
// var gaode_image = new ol.layer.Tile({
//   title: "高德地图-影像图层",
//   source: new ol.source.XYZ({
//     url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=6&x={x}&y={y}&z={z}",
//     wrapX: false,
//     /* 地图下载需要添加跨域参数 */
//     crossOrigin: "Anonymous",
//   }),
// });

const Tiandi_key = "5b92c46243748ef7ea92932c6a48f27c";
// 备用key 12e51ce15ffab22a33dbabab088a3ffb

var TiandiMap_vec = new ol.layer.Tile({
  className: "dark-mode",
  title: "天地图矢量图层",
  source: new ol.source.XYZ({
    url: `http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=${Tiandi_key}`,
    wrapX: false,
    crossOrigin: "Anonymous",
  }),
});
var TiandiMap_img = new ol.layer.Tile({
  title: "天地图影像图层",
  source: new ol.source.XYZ({
    url: `http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${Tiandi_key}`,
    wrapX: false,
    crossOrigin: "Anonymous",
  }),
  // zIndex: -1,
});

var TiandiMap_cva = new ol.layer.Tile({
  title: "天地图矢量注记图层",
  source: new ol.source.XYZ({
    url: `http://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=${Tiandi_key}`,
    crossOrigin: "Anonymous",
  }),
});
var TianDiMap_cia = new ol.layer.Tile({
  title: "天地图影像注记图层",
  source: new ol.source.XYZ({
    url: `http://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=${Tiandi_key}`,
    wrapX: false,
    crossOrigin: "Anonymous",
  }),
  visible: false,
});

export { TiandiMap_vec, TiandiMap_img, TiandiMap_cva, TianDiMap_cia };
